package com.hxzy.controller.admin;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.hxzy.common.annon.Log;
import com.hxzy.common.enums.BusinessType;
import com.hxzy.common.enums.ProjectModule;
import com.hxzy.common.vo.R;
import com.hxzy.controller.BaseController;
import com.hxzy.dto.SysDictTypeSearchDTO;
import com.hxzy.entity.SysDictType;
import com.hxzy.service.SysDictTypeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;

@Api(tags = "数据字典API")
@RestController
@RequestMapping(value = "/api/dicttype")
public class SysDictTypeController extends BaseController {

    @Autowired
    private SysDictTypeService sysDictTypeService;

    //spring security认证注解自定义的,NewBeeAuthorityBean实现的
     @PreAuthorize(value = "@nb.hasPermiss('system:dict:query')")
    // spring security自带的SecurityExpressionRoot实现的，超级管理员登录，它也会提示没有权限
    //@PreAuthorize(value = "hasAuthority('system:dict:query')")
    @ApiOperation(value = "分页查询")
    @GetMapping(value = "/data")
    public R search( SysDictTypeSearchDTO dto){
        IPage<SysDictType> page=this.sysDictTypeService.search(dto);
        return super.ipageToPage(page);
    }


}
